var countries = new Array();
function listVisibleMatches(id){
	agent.call('','getBetMatches','listVisibleMatchesCallback', id);
}

function listVisibleMatchesCallback(table){
	var result = '<a href="#" onclick="back()"> < Back </a><br/>';
	for(i=table.length-1; i>0;i--){
		result+= table[i][0]+'  -  '+table[i][1]+' '+table[i][2]+':'+table[i][3]+' - '+table[i][4]+'т.<br/>';
	}
	document.getElementById('top1').innerHTML = '<h2>Прогнози:</h2>';
	document.getElementById('content1').innerHTML = result;
}

function back(){
	agent.call('','list_ranking','backCallback');
}

function backCallback(table){
	document.getElementById('top1').innerHTML = '<h2>Класиране:</h2>';
	document.getElementById('content1').innerHTML = table;
}

function enableEditable3(){
//	alert(dump(countries,0));
	$('.edit_champ').editable('save_predictions.php',{
		id   : 'descr_id',
		name : 'newvalue',
		data : countries,
		type      : 'select',
		submit    : 'Запис',
		tooltip   : 'Цък за да редактираш...'
	});
	
}

function setCountries(list){
	countries = list;
}


